//created by: Lim Yi Le
Ext.define("MajorProjectSenchaTouch.view.LibraryUpdatesModule.LibraryUpdates", {
    extend: 'Ext.Container',
    xtype: 'libraryupdatespage',
    requires:[
        'MajorProjectSenchaTouch.view.LibraryUpdatesModule.LibraryUpdatesDataview'
    ],
    
    config: {
        style: 'background-color: #343433',
        layout:{
            fullscreen: true,
            type:'fit'
        },
        items:[
        {
            xtype: 'toolbar',
            ui: 'light',
            docked: 'top',
            items:[
            {
                xtype: 'spacer'
            },   
            {
                xtype: 'selectfield',
                id: 'libraryUpdatesPicker',
                name: 'category',
                align: 'right',
                usePicker: true,
                options: [
                    {text: 'All', value: 'All'},
                    {text: 'AV items', value: 'AV items'},
                    {text: 'Books', value: 'Books'},
                    {text: 'Cher Says...', value: 'Cher Says'},
                    {text: "Let's Talk About It", value: "Let%27s Talk About It"},
                    {text: 'Library News', value: 'Library News'},
                    {text: 'Library Workshops', value: 'Library Workshops'},
                    {text: 'New Arrivals', value: 'New Arrivals'},
                    {text: 'Noise', value: 'Noise'},
                    {text: 'Periodicals', value: 'Periodicals'}
                ],
            listeners:{
                    // handles any change in category selected
                    change: function(select, newValue, oldValue){
                        // for loading the summary content from the store
                        var contentSize = '/Summary';
                        // passes category to load store from server-side php using the correct TP Library API
                        var luController = MajorProjectSenchaTouch.app.getController('LibraryUpdates');
                        luController.displayBlogCategory(newValue, contentSize);
                    }
                }
            }
            ]
        },
        {
            cls: 'backgroundRightPanel',
            xtype: 'libraryupdatesdataview'
        }
        ]        
    }
});

